﻿@{
    ViewData["Title"] = ViewBag.SiteConfig.SiteName;
    ViewData["Description"] = ViewBag.SiteConfig.Description;
    Layout = null;
}
@inject ArticleService articleService
@inject ArticleCateService articleCateService
@inject ExtVideoService extVideoService
<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="@ViewData["Description"]">
    <meta name="author" content="Cdeng">
    <title>@ViewData["Title"]</title>
    <link href="~/lib/layui/css/layui.css" rel="stylesheet">
    <link href="~/home/css/main.css" rel="stylesheet">
   
</head>
<body>
    <!--头部部分 开始-->
    <partial name="_Header" />
    <!--头部部分 结束-->
    <!--头条小头条 开始-->
    <div class="layui-container" style="padding-top:50px;text-align:center;">
        <h1 class="cover-heading">
            @foreach (var item in await articleService.CxuuList("0", 1, "calist-right-toutiao", 600, 1))
            {
                <a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" class="nav-link">@item.Title</a>
            }
        </h1>
        <p class="lead">
            @foreach (var item in await articleService.CxuuList("0", 2, "calist-right-xiaotou2", 600, 2))
            {
                <a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" class="nav-link"> [ @StringUtility.Trim(item.Title, 28) ] </a>
            }
        </p>
        <hr class="layui-border-blue">
    </div>
    <!--头条小头条 结束-->
    <!--轮播部分 开始-->
    <div class="layui-container">
        <div class="layui-row layui-col-space8">
            <div class="layui-col-xs12 layui-col-md8">
                <div class="layui-carousel" id="test1" lay-filter="test1">
                    <div carousel-item="">
                        @foreach (var item in await articleService.CxuuList("0", 5, "imgcarouselx", 600, 3, true))
                        {
                            <div>
                                <div style="margin:auto;height:420px;"><a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" class="nav-link"><img src="@item.Img" width="757" height="410" /></a></div>
                                <div style="margin:auto;height:30px;"><a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" class="nav-link">@StringUtility.Trim(item.Title, 26)</a></div>
                            </div>

                        }
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12 layui-col-md4">
                <div class="layui-panel cxuu-list-topright" style="padding:5px;">
                    <ul>
                        @foreach (var item in await articleService.CxuuList("0", 13, "calist-right2", 600))
                        {
                            <li><span class="layui-badge-dot layui-bg-blue cxuu-dot-4x4"></span> <a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" class="nav-link">@StringUtility.Trim(item.Title, 18)</a></li>
                        }
                    </ul>
                </div>

                <form asp-controller="Search" asp-action="Index" method="get">
                    <div class="layui-row layui-col-space5" style="margin-top:10px;">
                        <div class="layui-col-md7">
                            <input type="text" name="keyword" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
                        </div>
                        <div class="layui-col-md5">
                            <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="submittitle"><i class="layui-icon">&#xe615;</i> Search </button>

                        </div>
                    </div>
                </form>

            </div>

            <div class="layui-hide-xs layui-col-md12">
                <div><img src="~/home/images/ad_index.jpg" width="1140" height="150" /></div>
            </div>
        </div>
    </div>
    <!--轮播部分 结束-->
    <!--第一部分 开始-->
    <div class="layui-container">
        <div class="layui-row layui-col-space10">
            <div class="layui-hide-xs layui-col-md2">
                <div class="layui-card">
                    <div class="layui-card-body cxuu-icon-list">
                        <ul>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-heart"></i>  <div class="cxuu-icon-namecxuu-icon-name">空心</div></li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-android"></i>  <div class="cxuu-icon-namecxuu-icon-name">安卓</div> </li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-ios"></i>  <div class="cxuu-icon-namecxuu-icon-name">IOS</div> </li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-windows"></i> <div class="cxuu-icon-namecxuu-icon-name">Windows</div> </li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-service"></i>  <div class="cxuu-icon-namecxuu-icon-name">服务</div> </li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-login-wechat"></i>  <div class="cxuu-icon-namecxuu-icon-name">微信</div> </li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-login-qq"></i>  <div class="cxuu-icon-namecxuu-icon-name">QQ</div> </li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-login-weibo"></i>  <div class="cxuu-icon-namecxuu-icon-name">微博</div> </li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-help"></i>  <div class="cxuu-icon-namecxuu-icon-name">帮助</div> </li>
                            <li class="layui-col-xs6 layui-col-md6"><i class="layui-icon layui-icon-star"></i>  <div class="cxuu-icon-namecxuu-icon-name">Star</div> </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12 layui-col-md10">
                <div class="layui-row  layui-col-space10">
                    <div class="layui-col-xs12 layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header cxuu-card-head"><a asp-area="Home" asp-controller="List" asp-action="Index" asp-route-id="1">学画</a></div>
                            <div class="layui-card-body  cxuu-list">
                                <ul>
                                    @foreach (var item in await articleService.CxuuListTag("cid='1' limit='11' cachetime='600' cachename='cate_1' img='false'  att='0' order='id' orderby='desc'"))
                                    {
                                        <li><span class="layui-badge-dot layui-bg-blue cxuu-dot-4x4"></span> <span class="cxuu-list-time">@item.Time.ToString("MM-dd")</span><a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" class="nav-link">@StringUtility.Trim(item.Title, 16)</a></li>
                                    }
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!--视频列表调用-->
                    <div class="layui-col-xs12 layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header cxuu-card-head"><a asp-area="Home" asp-controller="Video" asp-action="Index">视频列表</a></div>
                            <div class="layui-card-body  cxuu-list">
                                <ul>
                                    @foreach (var item in await extVideoService.VideoList("0", 10, "video_cate_2", 800))
                                    {
                                        <li><span class="layui-badge-dot layui-bg-blue cxuu-dot-4x4"></span> <span class="cxuu-list-time">@item.Time.ToString("MM-dd")</span><a asp-area="Home" asp-controller="Video" asp-action="Info" asp-route-id="@item.Id" class="nav-link">@StringUtility.Trim(item.Title, 16)</a></li>
                                    }
                                </ul>
                            </div>
                        </div>
                    </div>
                     <!--视频列表调用 end-->
                </div>
            </div>
        </div>
    </div>
    <!--第一部分 结束-->
    <!--第二部分 开始-->

    <div class="layui-container">
        <div class="layui-row layui-col-space10">
            @foreach (var cates in await articleCateService.CateListByIdAsync("3,4,6"))
            {
                <div class="layui-col-xs12 layui-col-md4">
                    <div class="layui-card">
                        <div class="layui-card-header cxuu-card-head"><a asp-area="Home" asp-controller="List" asp-action="Index" asp-route-id="@cates.Id">@cates.Name</a></div>
                        <div class="layui-card-body  cxuu-list">
                            <ul>
                                @foreach (var item in await articleService.CxuuList(cates.Id.ToString(), 10, "cates_" + cates.Id, 700))
                                {
                                    <li><span class="layui-badge-dot layui-bg-blue cxuu-dot-4x4"></span> <span class="cxuu-list-time">@item.Time.ToString("MM-dd")</span><a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" class="nav-link">@StringUtility.Trim(item.Title, 16)</a></li>
                                }
                            </ul>
                        </div>
                    </div>
                </div>
            }
        </div>
    </div>
    <!--第二部分 结束-->

     <partial name="_Footer" />
      <script src="~/lib/layui/layui.js"></script>
    <script>
        layui.use(['carousel'], function () {
            var carousel = layui.carousel;

            carousel.render({
                elem: '#test1'
                , arrow: 'always'
                , width: '100%'
                , height: '450px'
            });
        });
    </script>
</body>
</html>

